import { reqAddressInfo, reqtradeList } from '@/api'


const actions = {
  async getUserAddress({ commit }) {
    let result = await reqAddressInfo()
    if (result.code == 200) {
      commit('ADDRESS', result.data)
    }
  },
  async gettradeList({ commit }) {
    let result = await reqtradeList()
    if (result.code == 200) {
      commit('GETORDERIFG',result.data)
    }
  }
}
const mutations = {
  ADDRESS(state, address) {
    state.address = address
  },
  GETORDERIFG(state, orderInfo) {
    state.orderInfo =orderInfo
  }
}
const state = {
  address: [],
  orderInfo:{}
}
const getters = {}

export default {
  namespaced: true,
  actions,
  mutations,
  state,
  getters
}